package interview;

public class interview_02_02 {
    public int kthToLast(ListNode head, int k) {
        ListNode q=head;
        for(int i=0;i<k;++i){
            q=q.next;
        }
        ListNode p=head;
        while(q!=null){
            p=p.next;
            q=q.next;
        }
        return p.val;
    }
}
